{{define "Header"}}
<!DOCTYPE HTML>
<html lang="cn">
<head>
    <base href="/"/>
    <meta charset="utf-8"/>
	<meta name="viewport" content="width=device-width, user-scalable=no ,target-densitydpi=device-dpi ,initial-scale= 0.5"/>
    <title>计算机科学坚果会 - 西纳网</title>
    <script src="/static/js/jquery-1.8.0.js"></script>
    <link rel="stylesheet" href="/static/main.css" type="text/css">
    <link rel="stylesheet" href="/static/js/prettify/prettify.css" type="text/css">
    <script src="/static/js/prettify/prettify.js"></script>
    <script type="text/javascript">
        $(window).load(function(){
            $("img").each(function() {
                if($(this).width()>$(this).parent().width()) {
                    $(this).width("98%");
                }
            });
        });
        $(window).load(function(){
            $("pre > br").remove();
            prettyPrint();
        });
    </script>
    <script type="text/javascript">
        var curr=0;
        var prev=false;
		var next=true;
        DispNextPrev();
        
        function DispNextPrev() {
			//TODO:this function has to be fixed.
			// it's a fake function here.
			next=true;
			prev=true;
        }
        function Next() {
            curr+=10;
            $.ajax({url:"{{.QueryBase}}next="+curr,
                    success:function(htmlobj) {
                        $("#articles").html(htmlobj);
                    },
                    error:function(){
                        next=false;
                        curr-=10;
                    }
            });
            DispNextPrev();
        }
        function Prev() {
            curr-=10;
            $.ajax({url:"{{.QueryBase}}next="+curr,
                    success:function(htmlobj) {
                    $("#articles").html(htmlobj);
                    },
                    error:function(){
                        yet=false;
                    }
            });
            DispNextPrev();
        }
        function Del(msgid) {
            $.ajax({
                url:"{{.SiteBase}}/del/?id="+msgid,
                success:function(htmlobj) {
                    window.location.reload();
                },
                error:function(htmlobj){
                    alert("Bad Request");
                }
            });
        }
        function Good(msgid) {
            $.ajax({url:"{{.SiteBase}}/good/?id="+msgid,
                success:function(htmlobj) {
                    var good=$("#"+msgid).text();
                    good++;
                    $("#"+msgid).text(good);
               },
               error:function(htmlobj){
               }
            });
        }
//delete
function Del(msgid) {
	$.ajax({
url:"/del/?id="+msgid,
success:function(htmlobj) {
document.location.href="/";
},
error:function(htmlobj){
alert("Bad Request");
}});
}
//delete
function ResizeTextarea(id) {
	var t=document.getElementById(id);
	var h=t.scrollHeight;
	h=h>110?465:100;
	t.style.height=h+"px";
}
    </script>
</head>

<body>
    <header>
        <div id="loginbar"><p>{{.Loginbar}}</p></div>
	{{$u:=.U}}
        <div id="navbar">
				<a id="logo" href="/" >计算机科学坚果会 - 西纳网</a>
				<div class="clear"></div>
				<nav id="navbarItems">
					<li><a href="/tag/?tag=cpp">cpp</a></li>
					<li><a href="/tag/?tag=java">java</a></li>
					<li><a href="/tag/?tag=golang">golang</a></li>
					<li><a href="/tag/?tag=golang">ask</a></li>
					<li><a href="/tag/?tag=feature">feature</a></li>
				</nav>
        </div>
		<div class="clear"></div>
    </header>

    <div id="wrapper">
        <div id="rightbar">
            <div id="tagcloud">
                <h2>标签云</h2>
                <hr>
                <ul>
                    {{ range .TagCloud }} <a href="/tag/?tag={{.TagName}}" target="_blank">{{.TagName}}</a> {{end}}
                </ul>
            </div>
        </div>
        <!-- content start -->
        <div id="content">
{{end}}
